package cn.edu.sjtu.se.peakfactory.dao.bean;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import cn.edu.sjtu.se.lchang.socialnetwork.dao.bean.Tag;

@Entity
@Table(name = "PEAK_FACTORY_GAME_TABLE")
public class Game {
	private Long id;
	private String name;
	private String description;
	private Integer type;
	private List<Tag> tags;

	private Date registerTime;
	private Integer playerCount;

	private String url;
	private String creator;

	private String normalPic;
	private String bigPic;

	private boolean deleted;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "GAME_NAME")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "GAME_DESCRIPTION")
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "GAME_TYPE")
	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@ManyToMany
	@JoinTable(name = "GEEK_FACTORY_GAME_TAG_TABLE", joinColumns = @JoinColumn(name = "GANE_ID"), inverseJoinColumns = @JoinColumn(name = "TAG_ID"))
	public List<Tag> getTags() {
		return tags;
	}

	public void setTags(List<Tag> tags) {
		this.tags = tags;
	}

	@Column(name = "REGISTER_TIME")
	public Date getRegisterTime() {
		return registerTime;
	}

	public void setRegisterTime(Date registerTime) {
		this.registerTime = registerTime;
	}

	@Column(name = "PLAYER_COUNT")
	public Integer getPlayerCount() {
		return playerCount;
	}

	public void setPlayerCount(Integer playerCount) {
		this.playerCount = playerCount;
	}

	@Column(name = "GAME_URL")
	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	@Column(name = "GAME_CREATOR")
	public String getCreator() {
		return creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	@Column(name = "NORMAL_PIC")
	public String getNormalPic() {
		return normalPic;
	}

	public void setNormalPic(String normalPic) {
		this.normalPic = normalPic;
	}

	@Column(name = "BIG_PIC")
	public String getBigPic() {
		return bigPic;
	}

	public void setBigPic(String bigPic) {
		this.bigPic = bigPic;
	}

	@Column(name = "IS_DELETED")
	public boolean isDeleted() {
		return deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

}
